package com.ajavaer.framework.im.tencent.exception;

import com.ajavaer.framework.im.tencent.response.TencentImResponse;
import org.springframework.http.ResponseEntity;

public class TencentImException extends RuntimeException {
    private String message;

    public TencentImException() {
    }

    public TencentImException(String message) {
        this.message = message;
    }

    public TencentImException(ResponseEntity responseEntity) {
        this.message = "服务繁忙,请稍后再试:" + responseEntity.getStatusCode();
    }

    public TencentImException(TencentImResponse response) {
        this.message = response.getErrorCode() + ":" + response.getErrorInfo();
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
